<style>
.btn-my {font-size:0.5rem;margin-left:0.5rem;padding:0.2rem;float: right;height:1.2rem;line-height:0.76rem}
</style>
<div class="order-list-page" ng-if="pagedata.op == 'list' || pagedata.op == 'mylist' || pagedata.op == 'get'" style="padding-bottom:2.5rem">
    <div class="fui-header">
		<div class="fui-header-left" onclick="window.history.go(-1);">
            <a class="back"></a>
        </div>
		<div class="title">我的任务</div>
		<div class="fui-header-right"></div>
	</div>
	<div style="margin-top:2.2rem"></div>
	<div id="tab" class="fui-tab fui-tab-danger">
        <a ng-class="{'external active':pagedata.status == 0}"  ng-click="pagedata.status=0">待处理</a>
        <a ng-class="{'external active':pagedata.status == 1}"  ng-click="pagedata.status=1">处理中</a>
        <a ng-class="{'external active':pagedata.status == 2}"  ng-click="pagedata.status=2">处理完毕</a>
        <a ng-class="{'external active':pagedata.status == 3}"  ng-click="pagedata.status=3">已完成</a>
    </div>
	<div class='fui-content navbar order-list' style="top:2rem">
	<div class="fui-list-group order-item" ng-repeat="item in pagedata.list">
		<a class="fui-list external" >
			<div class='fui-list-inner'>
				 <div class="subtitle"> 任务号:{{item.ordersn}}
				 </div>
			</div>
			<div class="row-remark text-cancel" style="width: 4rem; font-size: 0.65rem;text-align: right;"> {{pagedata.statuss[item.status]}}</div>
			<div class="angle"></div>
		</a>
        <div class="fui-list goods-list">
                <a class="fui-list-inner" style="" href="{{item.linkurl}}" data-nocache="true">
                    <div class="title">{{item.title}}</div>
					<div class="title"><span style="color:#999;font-size:0.55rem"><i class="icon jinyunicon icon-shijian" style="color:#f60;font-size:0.50rem"></i> {{item.createtime}}</span>  <span class="status noremark" style="color:#f60;font-size:0.55rem">积分:{{item.credit}}.00 </span></div>
                </a>
         </div>
		 <div class="fui-list-group-title lineblock opblock">
				<span class="status noremark">
					<div class="btn btn-sm btn-primary-o order-delete" href="javascript:"  ng-click="access_json('edit','id='+item.id);">查看任务</div>
					<div class="btn btn-sm btn-danger-o order-delete"  href="javascript:" ng-click="post({},'del','id='+item.id)">删除任务</div>
				</span>
		 </div>
	</div>
	</div>
	<div class="content-empty" ng-show="pagedata.list.length == 0 ">
		  <i class="icon jinyunicon icon-cry" style="width: 6rem;margin-bottom: 0.5rem;"></i><br/><p style="color: #999;font-size: .75rem">您暂时没有任务！</p>
	</div>
	<div class="weui_btn_area" ng-show="pagedata.op == 'mylist' && pagedata.list.length == 0">
			<a class="weui_btn weui_btn_primary" href="javascript:;" ng-click="access_json('jy_workline/tcpmanage/edit')"><i class="icon jinyunicon icon-jia" style="width: 2rem;"></i>发布新任务</a>
	</div>
</div>
<div class='order-list-page' ng-if="pagedata.op == 'edit'" style="padding-bottom:2.5rem">
<div class="fui-header">
		<div class="fui-header-left" onclick="window.history.go(-1);">
            <a class="back"></a>
        </div>
		<div class="title">发布任务</div>
		<div class="fui-header-right"></div>
</div>
<div class="weui_cells weui_cells_form" style="margin-top:58px" >
	<div class="weui_cell weui_vcode">
        <div class="weui_cell_hd"><label class="weui_label">任务标题</label></div>
		<div class="weui_cell_bd weui_cell_primary">
			<input class="weui_input" type="text" ng-model="pagedata.item.title" placeholder="填写任务标题">
		</div>
    </div>
    <div class="weui_cell weui_cell_switch">
                <div class="weui_cell_hd weui_cell_primary">是否加急</div>
                <div class="weui_cell_ft">
                    <input class="weui_switch" ng-model="pagedata.item.jiaji" type="checkbox">
                </div>
    </div>
	<div class="weui_cells_title">任务分组</div>
	<div class="weui_cells weui_cells_radio2">
            <label class="weui_cell weui_check_label" ng-repeat="g in pagedata.groups" for="x21">
                <div class="weui_cell_bd weui_cell_primary">
                    <span>{{g.title}}</span>
                </div>
                <div class="weui_cell_ft">
                    <input type="radio" class="weui_check" ng-model="pagedata.item.groupid" name="radio1" id="x21">
                    <span class="weui_icon_checked"></span>
                </div>
            </label>
    </div>
	<div class="weui_cells_title">任务详情</div>
	<div class="weui_cells weui_cells_form">
            <div class="weui_cell">
                <div class="weui_cell_bd weui_cell_primary">
                    <textarea class="weui_textarea" ng-model="pagedata.item.content" placeholder="请输入详情" rows="3"></textarea>
                    <div class="weui_textarea_counter"><span>0</span>/200</div>
                </div>
            </div>
    </div>
	<div class="weui_cells_title">上传图片</div>
	<div class="weui_cells weui_cells_form">
            <div class="weui_cell">
                <div class="weui_cell_bd weui_cell_primary">
                    <div class="weui_uploader">
                        <div class="weui_uploader_bd">
                            <ul class="weui_uploader_files">
                                <li ng-repeat="(key,value) in pagedata.item.image" class="weui_uploader_file" style="background-image:url({{tomedia(value) || '../core/resource/images/nopic.jpg'}})"></li>
                            </ul>
                            <div class="weui_uploader_input_wrp">
                                <input class="weui_uploader_input" ng-click="up_file(pagedata.item,'image','image')" accept="image/jpg,image/jpeg,image/png,image/gif" multiple="">
                            </div>
                        </div>
                    </div>
                </div>
            </div>
   </div>
   <div class="weui_cell">
                <div class="weui_cell_hd"><label class="weui_label">积分</label></div>
                <div class="weui_cell_bd weui_cell_primary">
                    <input class="weui_input" type="number" pattern="[0-9]*" ng-model="pagedata.item.credit" placeholder="请输入积分">
                </div>
   </div>
</div>
<div class="weui_btn_area">
     <a class="weui_btn weui_btn_primary" href="javascript:" ng-click="post(pagedata.item,'edit')">提交</a>
</div>
</div>
<div class='order-list-page' ng-if="pagedata.op == 'look'">
			<div class="fui-header">
					<div class="fui-header-left" onclick="window.history.go(-1);">
						<a class="back"></a>
					</div>
					<div class="title">任务详情</div>
					<div class="fui-header-right"></div>
			</div>
			<div class="weui_cells" style="margin-top:50px">
			<div class="weui_cell weui_vcode">
					<div class="weui_cell_hd"><label class="weui_label">任务标题</label></div>
					<div class="weui_cell_bd weui_cell_primary">
						<span>{{pagedata.item.title}}</span>
					</div>
			</div>
			</div>
			<div class="weui_cells_title">任务详情</div>
			<div class="weui_cells weui_cells_form">
						<div class="weui_cell">
							<div class="weui_cell_bd weui_cell_primary">
								<p class="weui_textarea">{{pagedata.item.content}}</p>
							</div>
						</div>
			</div>
			<div class="weui_cells_title">任务图片</div>
			<div class="weui_cells weui_cells_form">
						<div class="weui_cell">
							<div class="weui_cell_bd weui_cell_primary">
								<div class="weui_uploader">
									<div class="weui_uploader_bd">
										<ul class="weui_uploader_files">
											<li ng-repeat="(key,value) in pagedata.item.image" class="weui_uploader_file" style="background-image:url({{tomedia(value) || '../core/resource/images/nopic.jpg'}})"></li>
										</ul>
									</div>
								</div>
							</div>
						</div>
			</div>
</div>
<div id="staff" class="modal fade" tabindex="-1" style="z-index: 99999; display: none;">
	<div class="modal-dialog" style="width:100%">
		<div class="modal-content">
			<div class="weui_cells_title">指派任务</div>
			<div class="weui_cells weui_cells_radio2">
					<label class="weui_cell weui_check_label" ng-repeat="w in pagedata.staffworkers" for="x21">
						<div class="weui_cell_bd weui_cell_primary">
							<span>{{w.title}}</span>
						</div>
						<div class="weui_cell_ft">
							<input type="radio" class="weui_check" ng-model="pagedata.staff.getmid" name="radio1" id="x21">
							<span class="weui_icon_checked"></span>
						</div>
					</label>
			</div>
			<div class="weui_btn_area">
				 <a class="weui_btn weui_btn_primary" href="javascript:" ng-click="post(pagedata.staff,'staff')">提交</a>
			</div>
		</div>
</div>
<script type="text/javascript">
scope.getstaff = function(id){
		var params1 = {
					'plugin':'jy_workline',
					'action':'tcpmanage',
					'op':'staff',
					'query':'id='+id,
					'data':{},
					'callback':function(data){
							console.log(data)
							if(data.success == 1){
								scope.$apply(function(){
									scope.pagedata.staffworkers = data.workers;
								});
							}
					}
		}
		scope.post_json(params1);
}
</script>
</div>
<div ng-include="sys_html('_footer')"></div>